/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.trick.admin;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author takahara
 */
public class Util {

    public static String keywordListToString(List<String> keywordList) {

        String keyWord = null;
        for(String keyWordTmp: keywordList) {
            if(keyWord == null) {
                keyWord = keyWordTmp;
            }else {
                keyWord = keyWord + "," + keyWordTmp;
            }
        }

        return keyWord;

    }

    public static List<String> keywordStringToList(String keywords) {

        List<String> stringList = new ArrayList();
        if(keywords != null && !keywords.equals("")) {
            String[] amznWdgtAsinsTmp = keywords.split(",");
            for(String txt: amznWdgtAsinsTmp) {
                if(!txt.isEmpty()) {
                    stringList.add(txt);
                }
            }
        }
        return stringList;
    }

}
